package org.mii.safeguard_v1.base.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.mii.safeguard_v1.base.entity.IdEntity;
import org.mii.safeguard_v1.security.entity.User;

@Entity
//@AccessType("field")
//表名与类名不相同时重新定义表名.
@Table(name = "deprecord_report")
//默认的缓存策略.
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class DepRecordReport extends IdEntity implements Serializable{

	
	private static final long serialVersionUID = 1L;
	private CtSP ctSP;
	private CtProvince ctProvince;
	private Set<User> users = new LinkedHashSet<User>(); // 有序的关联对象集合.

	private String depName;
	private String depAddCity;
	private String depPost;
	private String safeName;
	private String safeRank;
	private String safeOfftel;
	private String safeEmail;
	private String dutydep;
	private String linkman1Name;
	private String linkman1Rank;
	private String linkman1Offtel;
	private String linkman1Movtel;
	private String linkman1Email;
	private String linkman2Name;
	private String linkman2Rank;
	private String linkman2Offtel;
	private String linkman2Movtel;
	private String linkman2Email;
	private Date registdate;
	private int status;

	@Column(name = "dep_name")
	public String getDepName() {
		return depName;
	}

	public void setDepName(String depName) {
		this.depName = depName;
	}

	@Column(name = "dep_add_city")
	public String getDepAddCity() {
		return depAddCity;
	}

	public void setDepAddCity(String depAddCity) {
		this.depAddCity = depAddCity;
	}

	@Column(name = "dep_post")
	public String getDepPost() {
		return depPost;
	}

	public void setDepPost(String depPost) {
		this.depPost = depPost;
	}

	@Column(name = "safe_name")
	public String getSafeName() {
		return safeName;
	}

	public void setSafeName(String safeName) {
		this.safeName = safeName;
	}

	@Column(name = "safe_rank")
	public String getSafeRank() {
		return safeRank;
	}

	public void setSafeRank(String safeRank) {
		this.safeRank = safeRank;
	}

	@Column(name = "safe_offtel")
	public String getSafeOfftel() {
		return safeOfftel;
	}

	public void setSafeOfftel(String safeOfftel) {
		this.safeOfftel = safeOfftel;
	}

	@Column(name = "safe_email")
	public String getSafeEmail() {
		return safeEmail;
	}

	public void setSafeEmail(String safeEmail) {
		this.safeEmail = safeEmail;
	}

	public String getDutydep() {
		return dutydep;
	}

	public void setDutydep(String dutydep) {
		this.dutydep = dutydep;
	}

	@Column(name = "linkman1_name")
	public String getLinkman1Name() {
		return linkman1Name;
	}

	public void setLinkman1Name(String linkman1Name) {
		this.linkman1Name = linkman1Name;
	}

	@Column(name = "linkman1_rank")
	public String getLinkman1Rank() {
		return linkman1Rank;
	}

	public void setLinkman1Rank(String linkman1Rank) {
		this.linkman1Rank = linkman1Rank;
	}

	@Column(name = "linkman1_offtel")
	public String getLinkman1Offtel() {
		return linkman1Offtel;
	}

	public void setLinkman1Offtel(String linkman1Offtel) {
		this.linkman1Offtel = linkman1Offtel;
	}

	@Column(name = "linkman1_movtel")
	public String getLinkman1Movtel() {
		return linkman1Movtel;
	}

	public void setLinkman1Movtel(String linkman1Movtel) {
		this.linkman1Movtel = linkman1Movtel;
	}

	@Column(name = "linkman1_email")
	public String getLinkman1Email() {
		return linkman1Email;
	}

	public void setLinkman1Email(String linkman1Email) {
		this.linkman1Email = linkman1Email;
	}

	@Column(name = "linkman2_name")
	public String getLinkman2Name() {
		return linkman2Name;
	}

	public void setLinkman2Name(String linkman2Name) {
		this.linkman2Name = linkman2Name;
	}

	@Column(name = "linkman2_rank")
	public String getLinkman2Rank() {
		return linkman2Rank;
	}

	public void setLinkman2Rank(String linkman2Rank) {
		this.linkman2Rank = linkman2Rank;
	}

	@Column(name = "linkman2_offtel")
	public String getLinkman2Offtel() {
		return linkman2Offtel;
	}

	public void setLinkman2Offtel(String linkman2Offtel) {
		this.linkman2Offtel = linkman2Offtel;
	}

	@Column(name = "linkman2_movtel")
	public String getLinkman2Movtel() {
		return linkman2Movtel;
	}

	public void setLinkman2Movtel(String linkman2Movtel) {
		this.linkman2Movtel = linkman2Movtel;
	}

	@Column(name = "linkman2_email")
	public String getLinkman2Email() {
		return linkman2Email;
	}

	public void setLinkman2Email(String linkman2Email) {
		this.linkman2Email = linkman2Email;
	}

	public Date getRegistdate() {
		return registdate;
	}

	public void setRegistdate(Date registdate) {
		this.registdate = registdate;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
	@JoinColumn(name = "dep_sp_id")
	public CtSP getCtSP() {
		return ctSP;
	}

	public void setCtSP(CtSP ctSP) {
		this.ctSP = ctSP;
	}

	@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.LAZY)
	@JoinColumn(name = "dep_prov_id")
	public CtProvince getCtProvince() {
		return ctProvince;
	}

	public void setCtProvince(CtProvince ctProvince) {
		this.ctProvince = ctProvince;
	}

	@OneToMany(mappedBy = "depRecordReport", cascade = { CascadeType.PERSIST,
			CascadeType.MERGE, CascadeType.REMOVE }, fetch = FetchType.LAZY)
	public Set<User> getUsers() {
		return users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}

}
